<?php

/**
 * Created by PhpStorm.
 * User: changyifan
 * Date: 2018/1/26
 * Time: 下午3:51
 * 节模型
 */

namespace Home\Model;
use Think\Model\BaseModel;
class ChapterModel extends BaseModel{


	
    protected $_scope = array(
		'method' => array(
			'where' => array('tme_id'=>''),
			'field' => array('cha_id','cha_order','cha_name','tme_id')
		),
	);

    public function getChapterInfoListByAll(){
        $result = $this->select();

        if($result){
            return $result;
        }else{
            return array();
        }

    }
    public function getChapterInfoListWithCourseName($method_id){
//	 	if($method_id == 0){
//	 		$method_id = array('like','%%');
//	 	}

	 	$result = $this-> scope('method',array('where'=>array('tme_id'=>$method_id))) -> select();
        if($result){
            return $result;
        }else{
            return array();
        }
	 }
}


?>